//
//  CyclViewController.m
//  XingRun
//
//  Created by 赵颜彬 on 17/1/11.
//  Copyright © 2017年 赵颜彬. All rights reserved.
//

#import "CyclViewController.h"

@interface CyclViewController ()

@property(nonatomic, strong)UIImageView *shang1;

@property(nonatomic, strong)UIImageView *shang2;

@property(nonatomic, strong)UIImageView *shang3;

@property(nonatomic, strong)UILabel *shang4;

@property(nonatomic, strong)UIImageView *zhong1;

@property(nonatomic, strong)UILabel *zhong2;

@property(nonatomic, strong)UILabel *zhong3;

@property(nonatomic, strong)UILabel *zhong4;

@property(nonatomic, strong)UILabel *xia1;

@property(nonatomic, strong)UILabel *xia2;

@property(nonatomic, strong)UILabel *xia3;

@property(nonatomic, strong)UILabel *xia4;

@property(nonatomic, strong)UILabel *xia5;

@property(nonatomic, strong)UILabel *xia6;

@property(nonatomic, strong)UILabel *xia7;

@property(nonatomic, strong)UILabel *xia8;

@property(nonatomic, strong)UIImageView *down1;

@property(nonatomic, strong)UIImageView *down2;

@property(nonatomic, strong)UIImageView *down3;
@end

@implementation CyclViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"骑行";


    //右侧
    UIButton *releaseButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [releaseButton setImage:[UIImage imageNamed:@"照相"] forState:UIControlStateNormal];
    [releaseButton addTarget:self action:@selector(releaseInfo:) forControlEvents:UIControlEventTouchUpInside];
    releaseButton.frame = CGRectMake(0, 0, 40, 30);

    UIBarButtonItem *releaseButtonItem = [[UIBarButtonItem alloc] initWithCustomView:releaseButton];
    self.navigationItem.rightBarButtonItem = releaseButtonItem;
    
    //左侧
    UIButton *leftButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [leftButton setImage:[UIImage imageNamed:@"定位"] forState:UIControlStateNormal];
    leftButton.frame = CGRectMake(0, 0, 30, 30);

    [leftButton addTarget:self action:@selector(leftInfo:) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *leftButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftButton];
    self.navigationItem.leftBarButtonItem = leftButtonItem;

    [self creatop];
    [self creamedium];
    [self creahyponasty];
    [self creadown];
}
-(void)creatop{
    self.shang1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"上1"]];
    _shang1.frame = CGRectMake(20 * WIDTH, 80 * HEIGHT, 53 * WIDTH, 53 * HEIGHT);
    [self.view addSubview:_shang1];
    
    self.shang2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"上2"]];
    _shang2.frame = CGRectMake(160 * WIDTH, 80 * HEIGHT, 53 * WIDTH, 53 * HEIGHT);
    [self.view addSubview:_shang2];
    
    self.shang3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"上3"]];
    _shang3.frame = CGRectMake(260 * WIDTH, 80 * HEIGHT, 53 * WIDTH, 53 * HEIGHT);
    [self.view addSubview:_shang3];
    
    self.shang4 = [[UILabel alloc] init];
    _shang4.frame = CGRectMake(315 * WIDTH, 80 * HEIGHT, 53 * WIDTH, 53 * HEIGHT);
    _shang4.font = [UIFont fontWithName:@"Heiti SC" size:12];
    _shang4.text = @"台州\n22-24°C\n空气优";
    _shang4.numberOfLines = 0;
    [self.view addSubview:_shang4];
}
-(void)creamedium{
    self.zhong1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"中1"]];
    self.zhong1.frame =CGRectMake(90 * WIDTH, 180 * HEIGHT, 200 * WIDTH, 200 * HEIGHT);
    [self.view addSubview:_zhong1];
    
    self.zhong2 = [[UILabel alloc] init];
    self.zhong2.text = @"里程";
    self.zhong2.frame =CGRectMake(80 * WIDTH, 20 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    [self.zhong1 addSubview:_zhong2];
    
    self.zhong3 = [[UILabel alloc] init];
    self.zhong3.text = @"54.71";
    _zhong3.font = [UIFont fontWithName:@"Heiti SC" size:25];
    self.zhong3.frame =CGRectMake(70 * WIDTH, 80 * HEIGHT, 100 * WIDTH, 40 * HEIGHT);
    [self.zhong1 addSubview:_zhong3];
    
    self.zhong4 = [[UILabel alloc] init];
    self.zhong4.text = @"km";
    _zhong4.font = [UIFont fontWithName:@"Heiti SC" size:13];
    self.zhong4.frame =CGRectMake(90 * WIDTH, 140 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    [self.zhong1 addSubview:_zhong4];

}
-(void)creahyponasty{
    self.xia1 = [[UILabel alloc] init];
    _xia1.frame = CGRectMake(40 * WIDTH, 380 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    _xia1.font = [UIFont fontWithName:@"Heiti SC" size:14];
    _xia1.text = @"平均速度";
    [self.view addSubview:_xia1];
    
    self.xia4 = [[UILabel alloc] init];
    _xia4.frame = CGRectMake(40 * WIDTH, 420 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    _xia4.font = [UIFont fontWithName:@"Heiti SC" size:20];
    _xia4.text = @"14.2";
    [self.view addSubview:_xia4];
    
    self.xia7 = [[UILabel alloc] init];
    _xia7.frame = CGRectMake(40 * WIDTH, 460 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    _xia7.font = [UIFont fontWithName:@"Heiti SC" size:14];
    _xia7.text = @"km/h";
    [self.view addSubview:_xia7];
    
    self.xia2 = [[UILabel alloc] init];
    _xia2.frame = CGRectMake(150 * WIDTH, 380 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    _xia2.font = [UIFont fontWithName:@"Heiti SC" size:14];
    _xia2.text = @"骑行时间";
    [self.view addSubview:_xia2];
    
    self.xia5 = [[UILabel alloc] init];
    _xia5.frame = CGRectMake(150 * WIDTH, 420 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    _xia5.font = [UIFont fontWithName:@"Heiti SC" size:20];
    _xia5.text = @"03 : 12";
    [self.view addSubview:_xia5];
    
    self.xia3 = [[UILabel alloc] init];
    _xia3.frame = CGRectMake(290 * WIDTH, 380 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    _xia3.font = [UIFont fontWithName:@"Heiti SC" size:14];
    _xia3.text = @"消耗热量";
    [self.view addSubview:_xia3];
    
    self.xia6 = [[UILabel alloc] init];
    _xia6.frame = CGRectMake(290 * WIDTH, 420 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    _xia6.font = [UIFont fontWithName:@"Heiti SC" size:20];
    _xia6.text = @"34.87";
    [self.view addSubview:_xia6];
    
    self.xia8 = [[UILabel alloc] init];
    _xia8.frame = CGRectMake(290 * WIDTH, 460 * HEIGHT, 100 * WIDTH, 30 * HEIGHT);
    _xia8.font = [UIFont fontWithName:@"Heiti SC" size:14];
    _xia8.text = @"kcal";
    [self.view addSubview:_xia8];
}

-(void)creadown{
    self.down1 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"下1"]];
    _down1.frame = CGRectMake(60 * WIDTH, 520 * HEIGHT, 76 * WIDTH, 68 * HEIGHT);
    [self.view addSubview:_down1];
    
    self.down2 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"下2"]];
    _down2.frame = CGRectMake(156 * WIDTH, 520 * HEIGHT, 68 * WIDTH, 68 * HEIGHT);
    [self.view addSubview:_down2];
    
    self.down3 = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"下3"]];
    _down3.frame = CGRectMake(250 * WIDTH, 520 * HEIGHT, 70 * WIDTH, 70 * HEIGHT);
    [self.view addSubview:_down3];
    
}

-(void)releaseInfo:(UIButton *)btn{
    
}

-(void)leftInfo:(UIButton *)bt{
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
